package com.letoy.edu.controller;

import com.letoy.edu.service.LessonArrService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@Api(value = "选课管理", tags = "选课管理API")
public class LessonArrController {

    @Autowired
    LessonArrService lessonArrService;

    @PostMapping("/Arr/findAllLessonArr")
    @ApiOperation(value = "选课管理表查询所有", notes = "选课管理表查询所有")
    @ApiImplicitParam(value = "", name = "Authorization", paramType = "header", dataType = "String", required = true)
    private Map<String, Object> findAllLessonArr() {
        return lessonArrService.findAllLessonArr();
    }


    @PostMapping("/Arr/findLessonArrByNumberWeek")
    @ApiOperation(value = "选课管理表根据学号/周查询", notes = "选课管理表根据学号/周查询")
    @ApiImplicitParam(value = "", name = "Authorization", paramType = "header", dataType = "String", required = true)
    private Map<String, Object> findLessonArrByNumberWeek(int number, int week) {
        return lessonArrService.findLessonArrByNumberWeek(number, week);
    }

    @PostMapping("/Arr/insertLessonArr")
    @ApiOperation(value = "插入/课程选择", notes = "插入/课程选择")
    @ApiImplicitParam(value = "", name = "Authorization", paramType = "header", dataType = "String", required = true)
    private Map<String, Object> insertLessonArr(int studentId, int lessonId) {
        return lessonArrService.insertLessonArr(studentId, lessonId);
    }

}
